USE [Training]
GO

IF NOT EXISTS (SELECT * from dbo.sysobjects WHERE id = OBJECT_ID(N'dbo.training_api_EmployeeUpdate'))
	EXEC('CREATE PROC dbo.training_api_EmployeeUpdate AS')
GO
	
ALTER PROC dbo.training_api_EmployeeUpdate
	@EmployeeID		int,
	@FirstName		nvarchar(50),
	@LastName		nvarchar(50),
	@Email			nvarchar(100),
	@SmsNumber		nvarchar(11),
	@DepartmentTreeId	nvarchar(100),
	@IsActive		bit
AS
	UPDATE 
		Employee
	SET
		FirstName = @FirstName,
		LastName = @LastName,
		Email = @Email,
		SmsNumber = @SmsNumber,
		DepartmentTreeId = @DepartmentTreeId,
		IsActive = @IsActive
	WHERE
		EmployeeID = @EmployeeID
